
import React from 'react';
import DashBord from "../views/DashBord";
import JobCate from "../views/Job/JobCate";
import JobPub from "../views/Job/JobPub";
import UserInfo from '../views/User/UserInfo';
import {
    HomeFilled,
    CalendarFilled,
    FileImageFilled,
    SketchSquareFilled
  } from '@ant-design/icons';
import BannerList from '../views/Banner/BannerList';
import BannerPub from '../views/Banner/BannerPub';
import JobList from '../views/Job/JobList';
export const adminRoutes = [
    {
        path: 'dashbord',
        element: DashBord,
        key: "dashbord",
        label: '系统首页',
        icon:<HomeFilled/>
    },
    {
        key: "job",
        label: '岗位管理',
        icon:<CalendarFilled/>,
        children: [
           {
        path: 'job/jobcate',
        element: JobCate,
        key: "job/jobcate",
        label:'岗位分类'
    },
    {
        path: 'job/jobpub',
        element: JobPub,
        key: "job/jobpub",
        label:'岗位发布'
    },  
    {
        path: 'job/joblist',
        element: JobList,
        key: "job/joblist",
        label:'岗位列表'
    },
        ]
    },
    {
        key: "banner",
        label: '轮播管理',
        icon:<FileImageFilled/>,
        children: [
           {
        path: 'banner/bannerlist',
        element:BannerList,
        key: "banner/bannerlist",
        label:'轮播列表'
    },
    {
        path: 'banner/bannerpub',
        element: BannerPub,
        key: "banner/bannerpub",
        label:'轮播发布'
    },  
        ]
    },
    {
        key: "user",
        label: '用户管理',
        icon:<SketchSquareFilled />,
        children: [
           {
        path: 'user/userinfo',
        element:UserInfo,
        key: "user/userinfo",
        label:'用户信息'
    }
        ]
    },
   
]
export const filterRoutes = () => {
    let routes=[]
    adminRoutes.forEach(item => {
        if (item.children) {
            routes=[...routes,...item.children]
        } else {
            routes.push(item)
        }
    })
    return routes
}